import api from '../../../common/api';

export default function (record, index, props) {
    api.getBillLinkInfo({
        openbillid: _.get(record, 'pk_jkbx.value'),
        tradetype: _.get(record, 'djlxbm.value')
    }).then(res => {
        if (!res || !res.url) {
            toast({
                color: 'warning',
                content: this.state.multiLang['bad_request']
            }); /* 国际化处理： 参数错误*/
            return;
        }
        props.specialOpenTo(res.url, {
            status: 'browse',
            id: res.openbillid,
            tradetype: res.tradetype,
            appcode: res.appcode,
            pagecode: res.pagecode,
            scene: 'bz'
        });
    });
}
